package com.joker.aigc.oj.domain.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@Schema(description = "人才库，求职人员")
@TableName(value = "recruit")
public class Recruit implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "用户id 唯一")
    private Long id;

    @Schema(description = "报名部门")
    @NotNull(message = "人才招聘申请表id raId 必须填写")
    private Long raId;

    @Schema(description = "属于哪次人才录用计划")
    private Long pid;

    @Schema(description = "用户id,属于内部招聘时，不为空")
    private Long userId;

    @NotBlank(message = "用户名称username必须填写")
    private String username;

    @Schema(description = "教育水平")
    @NotNull(message = "教育水平必须填写")
    private Integer education;


    @Schema(description = "是否是应届生")
    @NotNull(message = "是否为应届生必须填写")
    private Integer freshStudent;

    @Schema(description = "简历路径")
    @NotBlank(message = "简历路径必须填写")
    private String cv;

    @Schema(description = "流程步骤 step 1: 投简历 step 2: 考试  step 3: 拟录用 step 4: 验证 step 5: 合同 step 6: 正式录用-》进入实习期。则信息录入正式员工库")
    private Integer step = 1;

    @Schema(description = "最终成绩")
    private Double score = 0.0;

    @Schema(description = "笔试成绩")
    private Double writeScore = 0.0;

    @Schema(description = "面试成绩")
    private Double meetingScore = 0.0;

    @Schema(description = "合同形式")
    private Integer contract = 0;

    @Schema(description = "邀请码")
    private String invitationCode;

    @Schema(description = "招聘来源")
    private String source;

    @Schema(description = "是否通过笔试")
    private Integer passWrite = 0;

    @Schema(description = "是否给笔试或面试的机会")
    private Integer pass = 0;

    @Schema(description = "是否通过面试")
    private Integer passMeeting = 0;

    @Schema(description = "个人自我介绍")
    private String introduce = "";

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "入职时间")
    private LocalDateTime start;


    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime gmtCreate;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "上次创建时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime gmtModified;

    @Schema(description = "乐观锁")
    @Version
    @TableField(fill = FieldFill.INSERT)
    private Integer version;

    @Schema(description = "逻辑是否删除")
    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    private Integer isDelete;

}
